// 函数组合调试
// NEVER SAY DIE -> never-say-die

const _ = require("loadsh");

// const log = (v) => {
//   console.log(v);
//   return v;
// };

//直观的看到log
const trace = _.curry((tag, v) => {
  console.log(tag, v);
  return v;
});

//_.split()
const split = _.curry((sep, str) => _.split(str, sep));

//_.toLower()

const join = _.curry((sep, arr) => _.join(arr, sep));

const map = _.curry((fn, arr) => _.map(arr, fn));

const f = _.flowRight(
  join("-"),
  trace("map之后"),
  map(_.toLower),
  trace("split之后"),
  split(" ")
);

console.log(f("NEVER SAY DIE"));
